<?php
class joinAction extends Action {
	public function index(){
        $o = M('job');
        $job = $o->where('display = 1')->select();
        $this->assign('job', $job);

		$this->display ();
	}

    public function contact() {

        $data = Array(
            'title' => $_GET['title'],
            'phone' => $_GET['phone'],
            'msg' => $_GET['msg'],
            'posttime' => time()
        );

        $o = M ( 'contact' );
        $st = $o->add ($data);

        if ($st !== false) {
            $result = Array(
                'status' => 1
            );
        } else {
            $result = Array(
                'status' => 0
            );
        }

        echo json_encode($result);
    }
}
?>